using System;
using System.Drawing;

namespace CosyTrade.UI
{
    public class ToolbarCommandItem
    {
        private readonly string commandKey;
        private Image icon;
        private string commandCaption;
        private bool beginGroup;
        private bool visible;
        private bool enable;
        private ToolbarCommandItemClickCallback OnClickCallback;
        
        public ToolbarCommandItem(string commandKey, string commandCaption, ToolbarCommandItemClickCallback onClickCallback)
        {
            this.commandKey = commandKey;
            this.commandCaption = commandCaption;
            OnClickCallback = onClickCallback;
        }

        public ToolbarCommandItem(string commandKey, Image icon, string commandCaption, bool beginGroup, bool visible, bool enable, ToolbarCommandItemClickCallback onClickCallback)
        {
            this.commandKey = commandKey;
            this.icon = icon;
            this.commandCaption = commandCaption;
            this.beginGroup = beginGroup;
            this.visible = visible;
            this.enable = enable;
            OnClickCallback = onClickCallback;
        }

        public string CommandKey
        {
            get { return commandKey; }
        }
        
        public Image Icon
        {
            get { return icon; }
            set { icon = value; }
        }

        public string CommandCaption
        {
            get { return commandCaption; }
            set { commandCaption = value; }
        }

        public bool BeginGroup
        {
            get { return beginGroup; }
            set { beginGroup = value; }
        }

        public bool Visible
        {
            get { return visible; }
            set { visible = value; }
        }

        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }

        public ToolbarCommandItemClickCallback OnClickCallback_
        {
            get { return OnClickCallback; }
            set { OnClickCallback = value; }
        }
    }

    public delegate void ToolbarCommandItemClickCallback(object sender, EventArgs e);
}